package com.amigo.online.provider.merchant.job;

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.amigo.online.common.param.result.goods.GoodsCalculationInfo;
import com.amigo.online.provider.merchant.mapper.GoodsMapper;
import com.amigo.online.provider.merchant.service.GoodsService;

/**
 * @version: V 1.0.0
 * @Description: （对类进行功能描述）
 * @author: zxy  QQ:1363320658
 * @date: 2018年12月26日 下午1:50:31
 */

@Component
public class GoodsWeightCalculationJob {

    private static final Logger logger = LoggerFactory.getLogger(GoodsWeightCalculationJob.class);

    @Autowired
    GoodsMapper goodsMapper;

    @Autowired
    GoodsService goodsService;

    @Autowired
    ExecutorService executorService;

    @Scheduled(cron = "0 0 2 * * ?")
    public void calculateGoodsWeight() {
        logger.info("----------");
        int maxId = goodsMapper.findMaxGoodsId();
        int index = maxId / 1000 + 1;
        for (int i = 1; i < index; i++) {
            int startId = i + 1000 * (i - 1);
            int endId = startId + 999;
        }
    }


}
